<template>
	<view>
		<view class="padding">
			<view class="cu-list menu-avatar comment">
				<block v-for="(item,index) in list" :key="index">
					<view class="cu-item margin-bottom radius-xl">
						<view class="cu-avatar round" :style="{backgroundImage: 'url('+item.member.avatar_url+')'}"></view>
						<view class="content">
							<view class="nickNameandTime">
								<view class="nickBox crow">
									<view class="text-black nickName">{{item.member.nickname || ''}}</view>
									<view class="text-gray text-sm">{{item.create_time || ''}}</view>
								</view>
							</view>
							<view class="text-sm score">
								<text class="cuIcon-favorfill text-orange padding-left-mn" v-for="(it,indexs) in item.score" :key="indexs"></text>
							</view>
							<view class="text-gray text-content text-df">
								{{item.comment || ''}}
							</view>
							<view class="tag flex flex-wrap padding-top-xs">
								<view v-for="(item,index) in item.tags" :key="index" class="padding-right-xs">
									<view class='cu-tag radius'>{{item}}</view>
								</view>
							</view>
							<view class="crow margin-top-sm text-sm" v-if="item.is_reply == 10">
								<text>阿姨回复：</text>
								<text class="text-gray">{{item.partner_reply || ''}}</text>
							</view>
						</view>
					</view>
				</block>
			</view>
		</view>

		<Loading v-if="pageLoading"/>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageLoading:false,
				emptyShow:false,
				list: [],
				current_page:1,
        userInfo:{}
			};
		},
		onLoad() {
      this.userInfo = uni.getStorageSync('userInfo') || {}
      if (!this.userInfo.id) return
      this.getList();
		},
		methods:{
			getList(){
        this.pageLoading = true;
        this.$http.getMyCommentList({
          member_id: this.userInfo.id,
        }).then(res=>{
          this.pageLoading = false;
          this.list = res
        })
			}
		}
	}
</script>

<style lang="less" scoped>
.comment{
	.content{
		.nickBox{
			width: 100%;
			justify-content: space-between;
		}
		.score{
			margin-top: -13upx;
		}
	}
}
</style>
